﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>市民建言</title>
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="/Content/amazeui/css/amazeui.min.css?v=1.0" />
    <link href="./css/citizen_advice.css" rel="stylesheet" type="text/css" />

    <link href="css/navbar.css" rel="stylesheet" type="text/css"/>
    <link href="./css/timeline.css" rel="stylesheet" type="text/css" />
    <script src="/Content/jquery/jquery-1.12.1.min.js"></script>
    <style>
        body
        {
            background-color: #EBECEE;
        }
        .am-comment-main
        {
            margin-left: 0;
        }
        .am-comment-hd
        {
            position: relative;
            background: none;
            border: none;
        }
        
        header.am-comment-hd:before
        {
            position: absolute;
            content: '';
            width: 8px;
            height: 8px;
            top: 8px;
            left: -2px;
            z-index: 2;
            border-radius: 4px;
            background-color: #FC8215;
        }
        .cd-container
        {
            width: 100%;
        }
        
        .cd-timeline-content
        {
            box-shadow: none;
        }
        .am-g
        {
            /*margin-top: 10px;*/
        }
        
        #cd-timeline
        {
            padding: 0;
            margin-top: 1rem;
        }
        
        #cd-timeline:before
        {
            z-index: 1;
            left: 1rem;
        }
        
        .cd-timeline-content
        {
            margin-left: 0;
        }
        
        h2.top_title
        {
            border-bottom: none;
            background: none;
            text-align: center;
            line-height: 32px;
            font-size: 20px;
        }
        
        h2.top_title span
        {
            font-size: 12px;
            color: #666;
            font-weight: 500;
        }
        
        .cd-timeline-block
        {
            margin: 1rem 0;
        }
        
        .am-thumbnails > li
        {
            padding: 0px;
        }
        
        .am-thumbnail
        {
            width: 100%;
        }
        
        .cd-timeline-content p
        {
            margin: 0;
        }
        
        .am-comment-bd
        {
            padding: 0px;
        }
        .am-with-fixed-navbar
        {
            padding-bottom: 50px;
        }
        .am-paragraph-default img
        {
            border: none;
        }
        header.am-comment-hd:before, #cd-timeline::before
        {
            display: none;
        }
        .cd-timeline-content p
        {
            margin-left: 8px;
        }
        .am-paragraph-default
        {
            margin-left: 0;
        }
        .am-thumbnails
        {
            margin-left: 5px;
        }
        .am-slider-c2 .am-slider-desc
        {
            font-size: 16px;
        }
        .am-slider-c2 .am-slider-desc, .am-slider-c3 .am-slider-desc
        {
            background-color: rgba(0,0,0,0.3);
        }
        header.am-comment-hd .ptitle
        {
            font-size: 20px;
            color: #000;
        }
        header.am-comment-hd .ptime
        {
            font-size: 8px;
            height: 18px;
        }
        .am-comment-bd .pcontent
        {
            font-size: 16px;
            color: Black;
        }

    </style>
</head>
<body class="am-with-fixed-navbar">
    <div class="content">
        <div data-am-widget="slider" class="am-slider am-slider-c2" data-am-slider='{&quot;directionNav&quot;:false}'>
            <ul class="am-slides">
                <vt:function var="hdp" method="getHdp" type="$this" rows="6" category="advice" />
                <vt:foreach from="$hdp" item="p" index="i">
          <li>
            <img src="{$p.img_url}" alt="{$p.title}" style="height:200px;" />
            <div class="am-slider-desc">{$p.title}</div>
          </li>
        </vt:foreach>
            </ul>
        </div>
        <section id="cd-timeline" class="cd-container">
       <vt:set var="orderby" value="message_id desc" id="norderby" />
       <vt:set var="pagesize" value="8" id="npagesize" />
      <vt:foreach from="$messages" item="p" index="i">
        <div class="cd-timeline-block">
          <div class="cd-timeline-content">
            <header class="am-comment-hd" style="">
              <p class="ptitle">{$p.title}</p>
            </header>
            <div class="am-comment-hd" >
              <p class="ptime">{$p.create_time}</p>
            </div>
            <div class="am-comment-bd" >
              <article data-am-widget="paragraph"
                       class="am-paragraph am-paragraph-default"
                       data-am-paragraph="{ tableScrollable: true, pureview: true }">
                <p class="pcontent">
                  {$p.content}
                </p>
                <ul class="am-avg-sm-3 am-thumbnails">
                  <vt:foreach from="$p.image_paths" item="path" index="j">
                    <li>
                      <img class="am-thumbnail" src="{$path}" alt="" style="height:100px;" />
                    </li>
                  </vt:foreach>
                </ul>
              </article>
            </div>
          </div>
        </div>
      </vt:foreach>
    </section>
        <div class="nav-bar" id="">
            <ul>
                <li>
                    <a href="tipoff.aspx?wid={$wid}&openid={$openid}">
                        我要爆料
                    </a>
                </li>
                <li>
                    <a href="/weixin/vote/index.aspx?wid={$wid}&aid={$ExtraValue}&openid={$openid}">
                        投票
                    </a>
                </li>
                <li>    
                    <a href="message.aspx?wid={$wid}&openid={$openid}">
                        留言
                    </a>
                </li>
            </ul>
        </div>
        <!-- <div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default" id="">
            <div class="weui_tabbar">
                <a href="message.aspx?wid={$wid}&openid={$openid}" class="weui_tabbar_item" data-id="button">
                    <div class="weui_grid_icon">
                        <img src="./images/icon_nav_button.png" alt="" />
                    </div>
                    <p class="weui_grid_label">
                        我要爆料
                    </p>
                </a><a href="/weixin/vote/index.aspx?wid={$wid}&aid={$ExtraValue}&openid={$openid}"
                    class="weui_tabbar_item" data-id="cell">
                    <div class="weui_grid_icon">
                        <img src="./images/icon_nav_cell.png" alt="" />
                    </div>
                    <p class="weui_grid_label">
                        投票
                    </p>
                </a>
                <<a href="message.aspx?wid={$wid}&openid={$openid}" class="weui_tabbar_item" data-id="toast">
                <a href="message.aspx?wid={$wid}&openid={$openid}" class="weui_tabbar_item" data-id="toast">
                    <div class="weui_grid_icon">
                        <img src="./images/icon_nav_toast.png" alt="" />
                    </div>
                    <p class="weui_grid_label">
                        留言
                    </p>
                </a>
            </div>
        </div>
    </div>-->
        <div id="uploader" style="display: none;">
            <input class="paishe" name="oaVideoFile" id="oaVideoFile" type="file" onchange="ajaxFileUpload('oaVideoFile')"
                accept="video/*" capture="camcorder" style="display: none;" />
            <input class="zhaoxiang" name="oaPicFile" id="oaPicFile" type="file" onchange="ajaxFileUpload('oaPicFile')"
                accept="image/*" capture="camera" style="display: none;" />
        </div>
        <vt:template id="share_js" file="/templates/csmall/_share_js.html" charset="utf-8" />
        <script src="/Content/amazeui/js/amazeui.min.js"></script>
        <script src="/Content/jquery/jquery.cookie.js"></script>
        <script src="/Content/jquery/jquery.ajaxfileupload.js"></script>
        <script src="/scripts/ls.js"></script>
        <script type="text/javascript">
            $(function () {

            });

            function showDialog() {
                var $dialog = $('#dialog');
                $dialog.show();
                var mask = $('#dialogmask');
                mask.show().addClass('weui_fade_toggle').one('click', function () {
                    $dialog.hide();
                });
                $('#dialogPic').one('click', function () {
                    $dialog.hide();
                    oaPicFile.click();
                });
                $('#dialogVideo').one('click', function () {
                    $dialog.hide();
                    oaVideoFile.click();
                });
                $dialog.find('.weui_actionsheet_cell').one('click', function () {
                    $dialog.hide();
                });
            }

            function showActionSheet() {
                var mask = $('#mask');
                var weuiActionsheet = $('#weui_actionsheet');
                weuiActionsheet.addClass('weui_actionsheet_toggle');
                mask.show().addClass('weui_fade_toggle').one('click', function () {
                    hideActionSheet(weuiActionsheet, mask);
                });
                $('#actionsheet_cancel').one('click', function () {
                    hideActionSheet(weuiActionsheet, mask);
                });
                weuiActionsheet.unbind('transitionend').unbind('webkitTransitionEnd');

                function hideActionSheet(weuiActionsheet, mask) {
                    weuiActionsheet.removeClass('weui_actionsheet_toggle');
                    mask.removeClass('weui_fade_toggle');
                    weuiActionsheet.on('transitionend', function () {
                        mask.hide();
                    }).on('webkitTransitionEnd', function () {
                        mask.hide();
                    })
                }
            }

            function ajaxFileUpload(objId) {
                var param = {
                    action: "message",
                    objId: objId,
                    id: 888,
                    t: Math.random()
                };

                $.ajaxFileUpload({
                    url: '../../../tools/upload_ajax.ashx',
                    data: param,
                    secureuri: false,
                    fileElementId: objId,
                    dataType: 'json',
                    success: function (data, status) {
                        //debugger;
                        if (objId == 'oaVideoFile') {
                            var fileType = 1;
                        } else {
                            var fileType = 2;
                        }
                        debugger;
                        var src = data.path;

                        if (src.length > 5) {
                            //var fileTxt='<span onclick=fileInfo("'+src+'",'+fileType+')>点击预览</span>';
                            var fileTxt = '上传成功';
                            $("#fileTxt").html(fileTxt);

                            var filePathVal = $("#filePath").val();
                            debugger;
                            var yl1Html = $("#yl1").html();
                            var yl2Html = $("#yl2").html();
                            var yl3Html = $("#yl3").html();
                            $("#filePath").val(filePathVal + '<' + src);
                        } else {
                            var fileTxt = '文件类型不允许';
                            $("#fileTxt").html(fileTxt);
                        }

                        LS.setLocalStorage('UploadFilePath', JSON.stringify(src));
                        self.location = '/modules/cdrt/smart/message.aspx?wid={$wid}';
                    },
                    error: function (data, status, e) {
                        alert("上传失败，请重试.." + e);
                    }
                });
                return false;
            }

        </script>
</body>
</html>
